<?php

/**
 * Interface to define a Connector, i.e. a class that can 
 * connect to a server and send / receive HTML.
 */
interface Connector {
	/**
	 * Constructor with the Proxy object and URL to connect to.
	 */
	function __construct($proxy, $url);
	
	/** 
	 * Sets the authentication info.
	 */
	function setLogin($username, $password);
	
	/** 
	 * Sets an array of name / value pairs to be POSTed in the request.
	 */
	function setPostInfo($fields);
	
	/** 
	 * Sets the referer to send in the request.
	 */
	function setReferer($referer);
	
	/** 
	 * Sets the cookie to send in the request.
	 */
	function setCookie($cookie);
	
	/** 
	 * Make a connection to the URL. Should return FALSE if the connection
	 * was unsuccessful, or TRUE if it was successful.
	 */
	function connect();
	
	/**
	 * Disconnect from the remote URL.
	 */
	function disconnect();
	
	/**
	 * Retrieve a textual description of the most recent connection error,
	 * or the empty string if there was none.
	 */
	function getError();
	
	/**
	 * Retrieve the headers sent as an array of name / value pairs.
	 */
	function getHeaders();
	
	/** 
	 * Retrieve the HTTP Code returned by this page.
	 */
	function getHttpCode();
	
	/** 
	 * Retrieve the output generated by the remote URL. If connect() has
	 * not yet been called, this will return NULL.
	 */
	function getOutput();
}

?>